// Ninf-G-XX, ver. 0.1
// Copyright 2011 National Institute of Advanced Industrial Science and Technology
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "FpOutputStream.h"
#include "DataOutputStream.h"
#include "NcFunctionInterface.h"
#include "NcFunctionInterfaceImpl.h"
#include "NcException.h"

int main(int argc, char ** argv){
  EBEGIN {

#if 0
    NcExpEntry entries_size_0_1_0[] = {
      NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression size_0_1_0(2, entries_size_0_1_0);
        NcExpEntry entries_start_0_1_0[] = {
	  NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression start_0_1_0(2, entries_start_0_1_0);
        NcExpEntry entries_end_0_1_0[] = {
	  NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression end_0_1_0(2, entries_end_0_1_0);
        NcExpEntry entries_step_0_1_0[] = {
	  NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression step_0_1_0(2, entries_step_0_1_0);

        NcParamDim dim_0_1_0(size_0_1_0, start_0_1_0, end_0_1_0, step_0_1_0);

        NcExpEntry entries_size_0_1_1[] = {
	  NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression size_0_1_1(2, entries_size_0_1_1);
        NcExpEntry entries_start_0_1_1[] = {
	  NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression start_0_1_1(2, entries_start_0_1_1);
        NcExpEntry entries_end_0_1_1[] = {
	  NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression end_0_1_1(2, entries_end_0_1_1);
        NcExpEntry entries_step_0_1_1[] = {
	  NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
        NcExpression step_0_1_1(2, entries_step_0_1_1);
        NcParamDim dim_0_1_1(size_0_1_1, start_0_1_1, end_0_1_1, step_0_1_1);

        NcParamDim ** dims_0_1 = new NcParamDim * [2];
        dims_0_1[0] = &dim_0_1_0;
        dims_0_1[1] = &dim_0_1_1;
        NcParamDesc desc_0_1(DT_INT, MODE_IN, 2, dims_0_1);

    NcExpEntry entries0[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpEntry entries1[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpEntry entries2[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpEntry entries3[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpression size(2, entries0);
    NcExpression start(2, entries1);
    NcExpression end(2, entries2);
    NcExpression step(2, entries3);

    NcParamDim dim0(size, start, end, step);

    NcExpEntry entries01[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpEntry entries11[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpEntry entries21[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpEntry entries31[] = {NcExpEntry(OP_VALUE_PLUS), NcExpEntry::inArg(1)};
    NcExpression size1(2, entries01);
    NcExpression start1(2, entries11);
    NcExpression end1(2, entries21);
    NcExpression step1(2, entries31);

    NcParamDim dim1(size1, start1, end1, step1);

    NcParamDim ** dims = new NcParamDim * [2];
    dims[0] = &dim0;
    dims[1] = &dim1;
    NcParamDesc desc_0_0(DT_INT, MODE_IN, 2, dims);

    NcParamDesc ** params_0 = new NcParamDesc * [2];
    params_0[0] = &desc_0_0;
    params_0[1] = &desc_0_1;    

    NcFunctionInterfaceImpl func_0(
      1, 1, "test", "mmul", 2, params_0, 
      "description", true);
#endif

#include "dec"

    FpOutputStream   fpOut(stdout);
    DataOutputStream dOut(&fpOut);
    
    func_0.writeTo(dOut);
  
    fflush(stdout);

    func_0.writeDeclaration(1, 0, stderr);
  
  } EEND
};









